package com.cfx.exercise_40;

import java.io.File;

public class MyThread extends Thread{
	public static void main(String[] args) {
		File file = new File("F:/java_SE");
		Thread t1 = new Thread(){
			public void run() {
				
				
				File[] files = file.listFiles();
				for (File file : files) {
					int i = 0;
					if(file.isDirectory()){
						i++;
					}
					System.out.println("文件个数为"+i);
				}
				
			}
		};
		Thread t2 = new Thread(){
			public void run(){
				File[] files = file.listFiles();
				for (File file : files) {
					if(file.length()>0){
						String[] names = file.list();
						for (String name : names) {
							System.out.println(name);
						}
					}
				}
				
			}
		};
		t1.start();
		t2.start();
		
	}
	

	
}
